<!--
 * @author: sanbao
 * @Date: 2022-09-05 14:56:57
-->
<style lang='scss' scoped>
#echarts5 {
  width: 100%;
  height: 100%;
}
</style>
<template>
  <div id="echarts5"></div>
</template>

<script>
import { ref, reactive, toRefs, computed, onMounted } from "vue";
import { a } from "../api/index";
export default {
  components: {},
  setup() {
    onMounted(() => {
      getdocument();
    });
    const getdocument = async () => {
      let myChart = echarts.init(document.getElementById("echarts5"));
      var data = [
        {
          value: 3661,
          name: "北美洲",
        },
        {
          value: 500,
          name: "欧洲",
        },
      ];
      const response = await a;
      myChart.setOption({
        legend: {
          orient: "horizontal",
          bottom: "5%",
          data: ["北美洲", "欧洲"],
        },
        series: [
          {
            type: "pie",
            selectedMode: "single",
            radius: ["40%", "58%"],
            color: ["#3e87e0", "#e57b78"],
            label: {
              normal: {
                position: "inner",
                formatter: "",
              },
            },
            data: data,
          },
        ],
      });
      window.onresize = function () {
        myChart.resize();
      };
    };
    return {};
  },
};
</script>
